import Vue from 'vue'
import pdSelectBox from './pdselectBox'

const pdSelectBoxConstructor = Vue.extend(pdSelectBox)
const BloodPicker = {};
let instance;
BloodPicker.create = function (options, callback) {
  instance = new pdSelectBoxConstructor({
    el: document.createElement('div')
  })

  instance.isShow = options.params.isShow
  instance.topCancel = options.params.topCancel
  instance.topOK = options.params.topOK
  callback && (instance.callback = callback)

  document.getElementById('app').appendChild(instance.$el)
  instance.setinitDate(options.params.initDate, options.params.initRelativeName)
}

BloodPicker.show = function () {
  instance.isShow = true
}
BloodPicker.close = function () {
  instance.isShow = false
}
export default BloodPicker
